package com.kerbores.meeting.domain;

import java.util.Set;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.ManyMany;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

/**
 * @author Kerbores
 *
 *         Create At 2015年1月12日 下午3:09:25
 */
@Table("nutz_position")
public class Position extends Entity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Comment("职位名称")
	@Column("name")
	private String name;
	@Comment("部门id")
	@Column("dept_id")
	private long departmentId;

	/**
	 * 职位部门
	 */
	@One(target = Department.class, field = "departmentId")
	private Department department;

	/**
	 * 用户角色
	 */
	@ManyMany(target = Role.class, relation = "nutz_pos_role", from = "pos_id", to = "role_id")
	private Set<Role> roles;
	/**
	 * 用户权限
	 */
	@ManyMany(target = Permission.class, relation = "nutz_pos_permission", from = "pos_id", to = "permission_id")
	private Set<Permission> permissions;

	/**
	 * @return the department
	 */
	public Department getDepartment() {
		return department;
	}

	/**
	 * @return the departmentId
	 */
	public long getDepartmentId() {
		return departmentId;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the permissions
	 */
	public Set<Permission> getPermissions() {
		return permissions;
	}

	/**
	 * @return the roles
	 */
	public Set<Role> getRoles() {
		return roles;
	}

	/**
	 * @param department
	 *            the department to set
	 */
	public void setDepartment(Department department) {
		this.department = department;
	}

	/**
	 * @param departmentId
	 *            the departmentId to set
	 */
	public void setDepartmentId(long departmentId) {
		this.departmentId = departmentId;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @param permissions
	 *            the permissions to set
	 */
	public void setPermissions(Set<Permission> permissions) {
		this.permissions = permissions;
	}

	/**
	 * @param roles
	 *            the roles to set
	 */
	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

}
